
//**INPUT**//TODO: Relocate to an Input.js
var keysDown = {};
var IE = document.all ? true : false    //Used to determine how to capture mouse movement
addEventListener("keydown", function (e) {keysDown[e.keyCode] = true;}, false);
addEventListener("keyup", function (e)  {delete keysDown[e.keyCode];}, false);



function input() {

    if (!IE) document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = getMouseXY;

}

function update() {
    map.update(baseDrone);
    //baseDrone.update(); //TODO: REMOVE, REPLACE WITH FULL UPDATELIST
}


function render() {

    l1Context.fillStyle = "rgb(0,100,100)";
    l1Context.fillRect(0, 0, l1Canvas.width, l1Canvas.height);
    


    l2Context.clearRect(0, 0, 800, 600);

    drawList.draw(baseDrone, 2);
    drawList.drawAll(map.gridList,1);
    baseDrone.update(); //TODO: REMOVE, REPLACE WITH FULL UPDATELIST


    l1Context.font = "18px Helvetica";
    l1Context.textAlign = "left";
    l1Context.textBaseline = "top";

    //drawList.draw(scoreBox, 1);
    l1Context.drawImage(drawList.Img[scoreBox.drawID], scoreBox.x, scoreBox.y);

    //**FOR DEBUG ONLY. TODO: REMOVE ONCE EATING IS FULLY IMPLEMENTED
    l1Context.fillStyle = "rgb(0, 0, 0)";
    l1Context.fillText("Arrows to move", 5, 0);
    l1Context.fillText("Press '1' to increase Drone LTCtr:" + baseDrone.LTCtr, 5, 20);
    l1Context.fillText("Press '2' to increase Drone MDCtr:" + baseDrone.MDCtr, 5, 40);
    l1Context.fillText("Press '3' to increase Drone HVCtr:" + baseDrone.HVCtr, 5, 60);
    l1Context.fillText("Drone transforms based on majority eaten", 5, 80);



}